﻿@model Chbl.ViewModels.HomeViewModel
@{
    ViewBag.Title = "Home Page";
}
 
<h2>@ViewBag.Message</h2>

<div class="bg1 pad">
    @Html.Partial("_TopNews", Model.TopNews)
    @Html.Partial("_Topics")
</div>

@*<div class="bg2 pad_top1">
    <div class="pad_2">
        <div class="wrapper">
            @Html.Partial("_LatestNews")
            @Html.Partial("_ScoreBoard")
        </div>
    </div>
</div>*@

<div class="bg2 pad_top1">
					<div class="pad_2"><div class="wrapper">
						<article class="col2 marg_right1">
							<ul class="tabs2">
							<li><a href="#tab1"><span>Положение команд</span></a></li>
							<li><a href="#tab2"><span>Результаты игр</span></a></li>
                            <li><a href="#tab3"><span>Расписание игр</span></a></li>
						</ul>

                        <div class="tab_container">
							    <div id="tab1" class="tab_content2">
								    <div class="wrapper pad_bot1">
                                        @foreach (var item in Model.TeamStandings)
                                        { 
                                            <h3 class="color1">Дивизион @item.Key.Division.Name</h3>
                                            @Html.Partial("_Standing", item.Value)
                                        }                                        
                                    </div>
                                 </div>

                                 <div id="tab2" class="tab_content2">
								    <div class="wrapper pad_bot1">
                                        @foreach (var item in Model.LatestTourSchedule)
                                        { 
                                            <h3 class="color1">Дивизион @item.Key.Division.Name</h3>                                            
                                            using (Ajax.BeginForm("GetGamesResult", 
                                                                   new AjaxOptions {
                                                                        UpdateTargetId = string.Format("GameResultsDivision{0}",@item.Key.SeasonDivisionId ),
                                                                        LoadingElementId = string.Format("Loading{0}", @item.Key.SeasonDivisionId),
                                                                        LoadingElementDuration = 2000
                                                                    }))
                                            {   
                                                <div id=@string.Format("Loading{0}", @item.Key.SeasonDivisionId) style="display:none; color:Red; font-weight: bold">                                              
                                                    <p>Идет загрузка данных...</p>
                                                </div>
                                                <div id=@string.Format("GameResultsDivision{0}",@item.Key.SeasonDivisionId )>
                                                    @Html.Partial("_GameResults", item.Value)
                                                </div>                                         
                                                @Html.Hidden("seasonDivisionId",  @item.Key.SeasonDivisionId)
                                                @Html.DropDownList("tourNumber", Model.TourNumbers)
                                                <input type="submit" value="Показать результаты тура"/>                                                
                                            }
                                        }                                        
                                    </div>
                                 </div>

                                 <div id="tab3" class="tab_content2">
								    <div class="wrapper pad_bot1">
                                        @foreach (var item in Model.GamesSchedule)
                                        { 
                                            <h3 class="color1">Дивизион @item.Key.Division.Name</h3>
                                            @Html.Partial("_Schedule", item.Value)
                                        }
                                    </div>
                                 </div>
                        </div>             
                    </article>
       </div>
    </div>
</div>

 @Html.Partial("_LatestPhotos", Model.LatestPhotos)